#/bin/bash
#restart go
op1=$1
op2=$2
go build -o ~/go/bin/$op1 $op2/$op1.go
echo "build $opt success"
pids=`ps aux|grep buildStkdata |grep -v "grep"|awk '{print$2}'`
for i in ${pids};do
if [ " " == ${i} ]; then
  echo "pids is enter"
else
  kill -9 ${i}
  echo "kill $i success"
fi
done
nohup $op1 >> /data/log/$op1.log 2>&1 &
echo "restart $op1 success"
